import { createStore } from 'vuex'
import { getCurrentInstance } from 'vue'
export default createStore({
  state: {
    playList: [{
      name: "眼睛泛红 突然间就留下了眼泪",
      id: 7000482409,
      al: {
        id: 89124290,
        name: "丢了你",
        pic: 109951164971975140,
        picUrl: "http://p3.music.126.net/aMvyZxMjGwxZpQL5nRpnQA==/109951164971975141.jpg"
      }
    }],
    searhList: [{
      name: "眼睛泛红 突然间就留下了眼泪",
      id: 7000482409,
      al: {
        id: 89124290,
        name: "丢了你",
        pic: 109951164971975140,
        picUrl: "http://p3.music.126.net/aMvyZxMjGwxZpQL5nRpnQA==/109951164971975141.jpg"
      }
    }],
    currentIndex: 0,
    lyricList: "",
    userInfo: {
      isLogin: false,
      userName: "未登录",
    }
  },
  mutations: {
    setPlayList: function (state, value) {
      state.playList = value;
    },
    setSearchList: function (state, value) {
      state.searhList = value;
    },
    pushPlayList: function (state, value) {
      state.playList.push(value);
      // state.playList = [...state.playList, ...[state]];
    },
    setCurrentIndex: function (state, value) {
      console.log('setCurrentIndex', value);
      state.currentIndex = value;
    },
    setLyric: function (state, value) {
      state.lyricList = value;
    }
  },
  actions: {
  },
  modules: {
  }
})
